<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<title><s:text name="system.page.title"/></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="js/jquery-1.8.0.js" charset="utf-8"></script>
<script type="text/javascript" src="js/ready.js" charset="utf-8"></script>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	function trClick(id) {
		$("#answer_id").val(id);
	}
	function trdbClick(id) {
		$("#answer_id").val(id);
		editorAnswer();
	}
	function saveAnswer() {
		$("#answer_id").val("");
		answerForm();
	}
	function editorAnswer() {
		var id = $("#answer_id").val();
		if(id != "") {				
			answerForm();
		} else {
			alert("<s:text name='system.rec.select'/>");
		}
	}
	function answerForm() {
		formId.action = "findAnswer.do";
		formId.submit();
	}
	function answerSearch(p) {
		$("#currentPage").val(p);
		formId.action = "searchAnswer.do";
		formId.submit();
	}
	function deleteAnswer() {
		var id = $("#answer_id").val();
		if(id != "") {
			if(confirm("<s:text name='system.rec.del'/>")) {				
				formId.action = "deleteAnswer.do";
				formId.submit();
			}
		} else {
			alert("<s:text name='system.rec.select'/>");
		}
	}
</script>
</head>
<body>
<div class="tools">
	<div class="tool">
	<ul>
		<li>
			<div onclick="saveAnswer();"><img src="image/button/NEW20.gif"/><span><s:text name='system.button.new'/></span></div>
		</li>
		<li>
			<div onclick="editorAnswer();"><img src="image/button/EDIT20.gif"/><span><s:text name='system.button.edit'/></span></div>
		</li>
		<li>
			<div onclick="deleteAnswer();"><img src="image/button/DEL20.gif"/><span><s:text name='system.button.del'/></span></div>
		</li>
	</ul>
	</div>
</div>
<form action="" method="post" id="formId" name="formId">
<input type="hidden" name="bean.answer_id" id="answer_id">
<s:hidden name="pageBean.currentPage" id="currentPage"/>
<div class="tabledata">
	<table border="0" cellpadding="0" cellspacing="0" width="100%" class="listtable">
		<tr class="trhead">
			<td><s:text name='system.rec.seq'/></td>
			<td><s:text name='rec.answer.answer_id'/></td>
			<td><s:text name='rec.answer.org_plan_id'/></td>
			<td><s:text name='rec.answer.empl_id'/></td>
			<td><s:text name='rec.answer.visit_date'/></td>
			<td><s:text name='rec.answer.answer_path'/></td>
			<td><s:text name='rec.answer.aut'/></td>
			<td><s:text name='rec.answer.flag'/></td>
			<td><s:text name='rec.answer.version'/></td>
		</tr>
		<s:set name="seq" value="pageBean.startRow + 1" />
		<s:set name="start" value="#seq"/>
		<s:iterator value="list" id="l">
		<tr <s:if test="#seq%2==0">class="trodd"</s:if><s:else>class="treven"</s:else> trclikc="trClick(<s:property value="#l.answer_id"/>)" trdbclick="trdbClick(<s:property value="#l.answer_id"/>)">
			<td><s:property value="#seq"/> </td>
			<td><s:property value="#l.answer_id"/></td>
			<td><s:property value="#l.org_plan_id"/></td>
			<td><s:property value="#l.empl_id"/></td>
			<td><s:property value="#l.visit_date"/></td>
			<td><s:property value="#l.answer_path"/></td>
			<td><s:property value="#l.aut"/></td>
			<td><s:property value="#l.flag"/></td>
			<td><s:property value="#l.version"/></td>
		</tr>
		<s:set name="seq" value="#seq + 1"/>
		</s:iterator>
		<s:set name="end" value="#seq-1"/>
	</table>
</div>
<div class="page">
	<div class="pagelist" style="width:100%;">
		<s:if test="list.size!=0">
		<span>
			<img src="image/button/start_off.gif" width="11" height="9" border="0" align="middle" onclick="deptSearch(<s:property value="pageBean.first"/>)">
			<span><s:text name='system.page.first'/></span>
			<img src="image/button/previous_off.gif" width="6" height="9" border="0" align="middle" onclick="deptSearch(<s:property value="pageBean.pre"/>)">
			<span><s:text name='system.page.pre'/></span>
			<span><s:property value="#start"/>-<s:property value="#end"/>/<s:property value="pageBean.totalRec"/><s:text name='system.page.rec'/> <s:property value="pageBean.currentPage"/>/<s:property value="pageBean.totalPage"/><s:text name='system.page.p'/></span>
			<span><s:text name='system.page.next'/></span>
			<img src="image/button/next_off.gif" width="6" height="9" border="0" align="middle" onclick="deptSearch(<s:property value="pageBean.next"/>)">
			<span><s:text name='system.page.last'/></span>
			<img src="image/button/end_off.gif" width="11" height="9" border="0" align="middle" onclick="deptSearch(<s:property value="pageBean.last"/>)">
		</span>
		</s:if>
	</div>
</div>
</form>
</body>
</html>
